<?php

// pet links
$accounts = array(
	array(
		'link' => $this->url(array('controller'=>'pets', 'action'=>'mypets'), 'default', true),
		'name' => $this->translate->_("My Pets"),
		'class' => 'lm-pets_sm'
	),
	array(
		'link' => $this->url(array('controller'=>'pets', 'action'=>'add'), 'default', true),
		'name' => $this->translate->_("Add Pet"),
		'class' => 'lm-pets_sm'
	),
	array(
		'link' => $this->url(array('controller'=>'pets', 'action'=>'archives'), 'default', true),
		'name' => $this->translate->_("Pet Archives"),
		'class' => 'lm-pets_sm'
	),
	array(
		'link' => $this->url(array('controller'=>'pets', 'action'=>'favorites'), 'default', true),
		'name' => $this->translate->_("My Favorite Pets"),
		'class' => 'lm-pets_sm'
	),
	array(
		'link' => $this->url(array('controller'=>'adoption', 'action'=>'adoptions'), 'default', true),
		'name' => $this->translate->_("My Pets for Adoption"),
		'class' => 'lm-pets_sm'
	)
);

if($this->showAdoptionInterest)
	$accounts[] = array(
		'link' => $this->url(array('controller'=>'adoption', 'action'=>'interested'), 'default', true),
		'name' => $this->translate->_("My Adoption Interests"),
		'class' => 'lm-pets_sm');

$links = null;
foreach($accounts as $link) {
	if (isset($link['class']) && strlen($link['class']) > 0)
		$links .= "<li><a href='{$link['link']}' class='{$link['class']}'><span>{$link['name']}</span></a></li>";
	else
		$links .= "<li><a href='{$link['link']}'>{$link['name']}</a></li>";
}

if($this->auth->hasIdentity())
	$this->placeholder('sidebar')
	     ->append("<h3>".$this->translate->_("Pets")."</h3>
	     	<ul class=\"leftsubmenu\" data-context=\"true\">{$links}</ul><div class=\"clear\"></div>");